package com.sxbbc.common.core.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

import java.util.ArrayList;
import java.util.List;

public enum OilRechargeProIdEnums {
    ZSH_100(10001,"中石化100元加油卡"),
    ZSH_200(10002,"中石化200元加油卡"),
    ZSH_500(10003,"中石化500元加油卡"),
    ZSH_1000(10004,"中石化1000元加油卡"),
    ZSY_NUMBER(10008,"中石油任意金额充值");

    private Integer id;

    private String name;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private OilRechargeProIdEnums(Integer id,String name){
        this.id=id;
        this.name=name;
    }

    public static List<OilRechargeProIdEnums> queryList(){
        List<OilRechargeProIdEnums> list=new ArrayList<>();
        for(OilRechargeProIdEnums o:OilRechargeProIdEnums.values()){
            list.add(o);
        }
        return list;
    }

    public static String getName(Integer id){
        String str="";
        for(OilRechargeProIdEnums o:OilRechargeProIdEnums.values()){
            if(CalcuUtils.getInstance().isEquals(id, o.getId())){
                str= o.getName();
                break;
            }
        }
        return str;
    }

    public static boolean isExist(Integer id) {
        for(OilRechargeProIdEnums o:OilRechargeProIdEnums.values()){
            if(CalcuUtils.getInstance().isEquals(id, o.getId())){
                return true;
            }
        }
        return false;
    }
}
